package com.bieyang.anjia.ui.activity;

import android.view.LayoutInflater;

import com.bieyang.anjia.R;
import com.wheel.widget.SildingFinishLayout;
import com.wheel.widget.SildingFinishLayout.OnSildingFinishListener;


/**
 * 继承BaseFlingActivity，实现滑动销毁
 * */
public class BaseFlingActivity extends BaseActivity {
	SildingFinishLayout contentView;

	@Override
	public void setContentView(int layoutResID) {
		super.setContentView(R.layout.base_view);
		contentView = (SildingFinishLayout) this.findViewById(R.id.sildingFinishLayout);
		LayoutInflater.from(this).inflate(layoutResID, contentView);

		contentView = (SildingFinishLayout) findViewById(R.id.sildingFinishLayout);
		contentView.setOnSildingFinishListener(new OnSildingFinishListener() {
			@Override
			public void onSildingFinish() {
				finish();
			}
		});
	}
	
	@Override
	public void onBackPressed() {
		super.onBackPressed();
		overridePendingTransition(0, R.anim.base_slide_right_out);
	}
}
